#include "array_gp.h"

int main()
{
    Array * mytestarray = NULL;
    mytestarray = arrayCreate();
    if (mytestarray == NULL) return -1;
    arrayInit(mytestarray, 10, 4);
    int a = 1, b = 2, c = 3, d = 4;   
    arrayInsert(mytestarray, 1, &a);
    arrayInsert(mytestarray, 2, &b);
    arrayInsert(mytestarray, 3, &c);

    printf("=== insert 1,3,2\n");
    
    size_t idx = arraySearchValue(mytestarray, &c);
    printf("3 is at postion %d\n", idx);
    
    idx = arraySearchValue(mytestarray, &d);
    printf("9 is at postion %d\n", idx);

    printf("=== delete [6] element\n");

    arrayDelValue(mytestarray, &b);
    arrayDelIndex(mytestarray, 1);

    return 0;
}
#include "Array_gp.h"

int main()
{
    Array * mytestarray = NULL;
    mytestarray = arrayCreate();
    if (mytestarray == NULL) return -1;
    arrayInit(mytestarray, 10, 4);
    int a = 1, b = 2, c = 3, d = 4;   
    arrayInsert(mytestarray, 1, &a);
    arrayInsert(mytestarray, 2, &b);
    arrayInsert(mytestarray, 3, &c);

    printf("=== insert 1,3,2\n");
    
    size_t idx = arraySearchValue(mytestarray, &c);
    printf("3 is at postion %d\n", idx);
    
    idx = arraySearchValue(mytestarray, &d);
    printf("9 is at postion %d\n", idx);

    printf("=== delete [6] element\n");

    arrayDelValue(mytestarray, &b);
    arrayDelIndex(mytestarray, 1);

    return 0;
}
